﻿@model EntryViewModel

@{ this.Layout = "~/Views/Shared/Layout.cshtml"; }

@this.Html.RenderMessage()

<div class="sitePath">
	<a title="@this.Model.PageDescription" href="@this.Url.Action("List", new { pageNumber = 1, viewType = this.Model.ViewType, tag = (string)null })">@this.Model.PageName</a>
	> 
	<a href="@this.Url.Action("View", new { entryId = this.Model.Id, viewType = this.Model.ViewType })" title="@this.Model.Title">@this.Model.Title</a>
</div>

@this.Html.Partial("ViewEntry", this.Model)

@if (this.Model.DisplayComments)
{ 
	<hr />
	<div class="comments">
		<h2 id="comments">@Resources.Comments (<span class="commentsCount">@this.Model.Comments.Count</span>)</h2>
	
		@foreach (CommentViewModel commentViewModel in this.Model.Comments)
		{
			if (commentViewModel.DisplayMode == CommentDisplayMode.View)
			{
				this.Html.RenderPartial("CommentView", commentViewModel);
			}
			else
			{
				this.Html.RenderPartial("CommentEdit", commentViewModel);
			}
		}

		<h2 id="addComment">@Resources.AddComment</h2>
		@this.Html.Partial("CommentEdit", this.Model.Comments.NewComment)
	</div>
}